import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const  paper={

}
/*暂时用不到
*/
export default new Vuex.Store({

    //这里可以定义需要全局共享的数据
    state: {
        baseSrc:"http://"+document.location.host+"/",
        fileBaseSrc:"http://192.168.200.128:8080/",
        VueName: 'QDQ问卷',
        userId: '',
        name: '',
        //paper.vue数据
        paper: {
            id: '',
            userId: '',
        },
    },
    //用于变更State的数据
    mutations: {
        insertTitle(state, title) {
            state.paper.title = title;
        },
        insertUserId(state, id) {
            state.userId = id;
        },
        updateSurveyId(state, id) {
            state.selected_surveyId = id;
        },
        updateName(state, name) {
            state.name = name;
        },
        cleanPaper(state) {
            state.paper = { };
        }
    },
    actions: {},
    modules: {}
})
